package servlet.admin;

import dao.UserDao;
import dao.service.UserDaoImp;
import modle.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author DELL
 */

@WebServlet("/manage/adminToUserUpdate")
public class ToUserUpdate extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        UserDao userDao = new UserDaoImp();
        User user = userDao.getUser(id);

        req.setAttribute("user",user);
        req.setAttribute("page",req.getParameter("page"));

        req.getRequestDispatcher("adminUserUpdate.jsp").forward(req,resp);
    }
}
